using System;
using System.Windows.Forms;
using DevExpress.XtraSplashScreen;
using NAGFwk.UI.Properties;

namespace NAGFwk.UI
{
    public partial class SsMain : DemoSplashScreen
    {
        int _dotCount = 0;
        public SsMain()
        {
            InitializeComponent();
            labelControl1.Text = string.Format("{0}{1}", labelControl1.Text, GetYearString());
            DemoText = Resources.WelcomeText;
            ProductText = "Silkey ERP";
            Timer tmr = new Timer {Interval = 400};
            tmr.Tick += tmr_Tick;
            tmr.Start();
        }

        void tmr_Tick(object sender, EventArgs e)
        {
            if (++_dotCount > 3) _dotCount = 0;
            labelControl2.Text = string.Format("{1}{0}", GetDots(_dotCount), Resources.Starting);
        }

        string GetDots(int count)
        {
            string ret = string.Empty;
            for (int i = 0; i < count; i++) ret += ".";
            return ret;
        }
        int GetYearString()
        {
            int ret = DateTime.Now.Year;
            return (ret < 2012 ? 2012 : ret);
        }
    }
}
